import 'package:k3cloud_api/params/request_param.dart';

/// it is used to build parameters to request the view interface.
class ViewParam extends RequestParam {
  @override
  String getRequestPath() {
    return "DynamicFormService.View";
  }

  @override
  Map<String, dynamic> toJson() {
    Map<String, dynamic> data = {};
    if (createOrgId != null) data["createOrgId"] = createOrgId;
    if (number != null) data["number"] = number;
    if (id != null) data["id"] = id;

    Map<String, dynamic> json = {};
    if (formId != null) json["formId"] = formId;
    json["data"] = data;
    return json;
  }

  String? formId;
  int? createOrgId;
  String? number;
  int? id;

  static _Builder builder() {
    return _Builder();
  }
}

class _Builder {
  final ViewParam _param = ViewParam();

  ViewParam build() => _param;
  
  _Builder formId(String formId) {
    _param.formId = formId;
    return this;
  }

  _Builder createOrgId(int createOrgId) {
    _param.createOrgId = createOrgId;
    return this;
  }

  _Builder number(String number) {
    _param.number = number;
    return this;
  }

  _Builder id(int id) {
    _param.id = id;
    return this;
  }
}